define(function () {
    'use strict';
    function ctrl($scope, WebService) {
        function init() {
            $scope.status = true;
            WebService.getSaleDepartment().then(function (data) {
                $scope.status = false;
                if (data && data.length > 0) {
                    $scope.departmentList = data;
                }
            })
        }

        $scope.$on('$ionicView.beforeEnter', function () {
            init()
        });
    }

    ctrl.$inject = ['$scope', 'WebService'];
    return ctrl;
});